using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace NUMP4CS
{
    [Table("Post")]
    public class Post
    {
        public int Id { get; set; }
        public string Title { get; set; }
        [Column("Content", TypeName="ntext")] 
        public string Content { get; set; }
        public Person CreatedBy { get; set; }
        public Person UpdatedBy { get; set; }
    }
    [Table("Person")]
    public class Person
    {
        [Key, Required]
        public int Id { get; set; }
        public string Name { get; set; }
        [InverseProperty("CreatedBy")]
        public List<Post> PostsWritten { get; set; }
        [InverseProperty("UpdatedBy")]
        public List<Post> PostsUpdated { get; set; }
    }
}
